<div class="row tab1-center" style="margin-top:15px;">
  <div class="container1">
    <form #addForm="ngForm" (ngSubmit)="_onSubmit(addForm.value)">
      <div class="input_div"  *ngFor="let val of tabVal;let isFirst=first;let i = index;">
        <label [ngClass]="{'input_title': val.inputType != 'textarea','textarea_title textarea_attribute': val.inputType == 'textarea'}">{{val.metaName}}：</label>
        
        <input *ngIf="val.inputType == 'text'" class="input_attributeStyle" name="{{val.metaId}}" #{{val.metaId}}="ngModel" [ngModel]="val.metaValue" 
        placeholder="请输入{{val.metaName}}">

        <textarea *ngIf="val.inputType == 'textarea'" class="textarea_textareaStyle textarea_attribute" 
        style="width:390px;" name="{{val.metaId}}" #{{val.metaId}}="ngModel" [ngModel]="val.metaValue" 
        placeholder="请输入{{val.metaName}}"></textarea>

        <div class="input_div" style="display:inline" *ngIf="_isTime(val.inputType) != 'OTHER'">
          <span style="margin-right:5px;" *ngIf="_isTime(val.inputType) == 'AD'">公元</span>
          <span style="margin-right:5px;" *ngIf="_isTime(val.inputType) == 'BC'">公元前</span>

          <div style="display:inline" *ngIf="val.inputType == 'year' || val.inputType == 'bcyear'">
            <input class="input_attributeStyle_time"
            name="{{val.metaId}}_year" #{{val.metaId}}_year="ngModel" [(ngModel)]="val.metaValueYear" 
            placeholder="年份" maxlength="4"><span class="inputType_span">年</span>
            <div class="text-danger" *ngIf="_isYear(val.metaValueYear)"><span class="timeSpan" data-error="true"></span>请输入字符长度为1-4位数的年份！</div>
          </div>

          <div style="display:inline" *ngIf="val.inputType == 'yearmonth' || val.inputType == 'bcyearmonth'">
            <input class="input_attributeStyle_time" 
            name="{{val.metaId}}_year" #{{val.metaId}}_year="ngModel" [(ngModel)]="val.metaValueYear" 
            placeholder="年份" maxlength="4"><span class="inputType_span">年</span>
            <input type="number" class="input_attribute_month_time" 
            name="{{val.metaId}}_month" #{{val.metaId}}_month="ngModel" [(ngModel)]="val.metaValueMonth" 
            placeholder="月" min="0" max="12" oninput="if(value.length>2)value=value.slice(0,2)"><span class="inputType_span">月</span>
            <div class="text-danger" *ngIf="_isYear(val.metaValueYear)"><span class="timeSpan" data-error="true"></span>请输入字符长度为1-4位数的年份！</div>
            <div class="text-danger" *ngIf="_isMonth(val.metaValueYear,val.metaValueMonth)"><span class="timeSpan" data-error="true"></span>年份不能为空，且请输入正确的月份！</div>
          </div>

          <div style="display:inline" *ngIf="val.inputType == 'date' || val.inputType == 'bcdate'">
            <input class="input_attributeStyle_time" 
            name="{{val.metaId}}_year" #{{val.metaId}}_year="ngModel" [(ngModel)]="val.metaValueYear" 
            placeholder="年份" maxlength="4"><span class="inputType_span">年</span>
            <input type="number" class="input_attribute_month_time" 
            name="{{val.metaId}}_month" #{{val.metaId}}_month="ngModel" [(ngModel)]="val.metaValueMonth" 
            placeholder="月" min="0" max="12" oninput="if(value.length>2)value=value.slice(0,2)"><span class="inputType_span">月</span>
            <input type="number" class="input_attribute_month_time" 
            name="{{val.metaId}}_day" #{{val.metaId}}_day="ngModel" [(ngModel)]="val.metaValueDay" 
            placeholder="日" min="0" max="31" oninput="if(value.length>2)value=value.slice(0,2)"><span class="inputType_span">日</span>
            <div class="text-danger" *ngIf="_isYear(val.metaValueYear)"><span class="timeSpan" data-error="true"></span>输入字符长度为1-4位数的年份</div>
            <div class="text-danger" *ngIf="_isMonth(val.metaValueYear,val.metaValueMonth)"><span class="timeSpan" data-error="true"></span>年份不能为空，且请输入正确的月份！</div>
            <div class="text-danger" *ngIf="_isDay(val.metaValueYear,val.metaValueMonth,val.metaValueDay)"><span class="timeSpan" data-error="true"></span>年份与月份不能为空，且请输入正确的天数！</div>
          </div>

          <div style="display:inline" *ngIf="val.inputType == 'datetime' || val.inputType == 'bcdatetime'">
            <input class="input_attributeStyle_time" 
            name="{{val.metaId}}_year" #{{val.metaId}}_year="ngModel" [(ngModel)]="val.metaValueYear" 
            placeholder="年份" maxlength="4"><span class="inputType_span">年</span>
            <input type="number" class="input_attribute_month_time" 
            name="{{val.metaId}}_month" #{{val.metaId}}_month="ngModel" [(ngModel)]="val.metaValueMonth" 
            placeholder="月" min="0" max="12" oninput="if(value.length>2)value=value.slice(0,2)"><span class="inputType_span">月</span>
            <input type="number" class="input_attribute_month_time" 
            name="{{val.metaId}}_day" #{{val.metaId}}_day="ngModel" [(ngModel)]="val.metaValueDay" 
            placeholder="日" min="0" max="31" oninput="if(value.length>2)value=value.slice(0,2)"><span class="inputType_span">日</span>
            <input type="number" class="input_inputStyle_time" name="{{val.metaId}}_time" #{{val.metaId}}_time="ngModel" [(ngModel)]="val.metaValueTime" min="00" max="23" oninput="if(value.length>2)value=value.slice(0,2)" style="margin-left:5px;"/>
            <span class="inputType_span">:</span>
            <input type="number" class="input_inputStyle_time" name="{{val.metaId}}_minute" #{{val.metaId}}_minute="ngModel" [(ngModel)]="val.metaValueMinute" min="00" max="59" oninput="if(value.length>2)value=value.slice(0,2)"/>
            <span class="inputType_span">:</span>
            <input type="number" class="input_inputStyle_time" name="{{val.metaId}}_second" #{{val.metaId}}_second="ngModel" [(ngModel)]="val.metaValueSecond" min="00" max="59" oninput="if(value.length>2)value=value.slice(0,2)"/>
            <div class="text-danger" *ngIf="_isYear(val.metaValueYear)"><span class="timeSpan" data-error="true"></span>输入字符长度为1-4位数的年份</div>
            <div class="text-danger" *ngIf="_isMonth(val.metaValueYear,val.metaValueMonth)"><span class="timeSpan" data-error="true"></span>年份不能为空，且请输入正确的月份！</div>
            <div class="text-danger" *ngIf="_isDay(val.metaValueYear,val.metaValueMonth,val.metaValueDay)"><span class="timeSpan" data-error="true"></span>年份与月份不能为空，且请输入正确的天数！</div>
            <div class="text-danger" *ngIf="_isTMS('t',val.metaValueTime) || _isTMS('m',val.metaValueMinute) || _isTMS('s',val.metaValueSecond)"><span class="timeSpan" data-error="true"></span>时分秒不能超出正常范围，时（0-23）、分与秒（0-59）！</div>
          </div>
          
        </div>
      </div>
      <div class="col-lg-12 col-md-12 col-sm-12 tab1-foot" style="text-align:center">
        <button class="btn btn-info01 btn-blue" 
        *ngIf="internalParam.completeStatus != '1' && tabVal && tabVal.length > 0"
        [disabled]="_timeError()"
        mat-button>保存</button>
      </div>
    </form> 
  </div>
</div>
